package com.androinject.core.aware;

import com.androinject.core.ComponentFactory;
import com.androinject.core.definitions.ComponentDefinition;
import com.androinject.core.definitions.ManagedComponentDefinition;

public class ComponentFactoryAwareProcessor extends AbstractAwareProcessor<ComponentFactoryAware> {
	
	protected ComponentFactory componentFactory;

	
	public ComponentFactoryAwareProcessor(ComponentFactory componentFactory) {
		super(ComponentFactoryAware.class);
		this.componentFactory = componentFactory;
	}
	

	@Override
	protected void handleComponent(ComponentFactoryAware component, ComponentDefinition definition) {
		component.setComponentFactory(this.componentFactory);
	}
	

	@Override
	protected void handleManagedComponent(ComponentFactoryAware component, ManagedComponentDefinition definition) {
		component.setComponentFactory(this.componentFactory);
	}

}
